package com.css.zfzx.sjcj.common.utils;

import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Field;
import java.util.List;

/**
 * @Description 校验对象中参数是否为空
 * @Author zyc
 * @Date 2021/2/5 16:51
 * @Version V1.0
 */
@Slf4j
public class CheckObjFields {

    /**
     * 属性转换，在大写前加‘_’并把大写转换成小写
     *
     * @param property          属性
     * @return String
     * @throws Exception
     */
    public static String propertyChange(String property) {
        StringBuilder sb=new StringBuilder();
        char[] chars = property.toCharArray();
        for (char c : chars) {
            if (Character.isUpperCase(c)){
                sb.append(("_"+c).toLowerCase());
                continue;
            }
            sb.append(c);
        }
        return sb.toString();
    }
}
